Skip to content

Handle missing roots in holder-extensible calls - #3043

Open
Jackmeson1 wants to merge 1 commit into
lballabio:masterfrom
Jackmeson1:fix/holder-extensible-missing-roots
Open

Jackmeson1 wants to merge 1 commit into
lballabio:masterfrom
Jackmeson1:fix/holder-extensible-missing-roots

Conversation

@Jackmeson1

Copy link
Copy Markdown
Contributor

AnalyticHolderExtensibleOptionEngine searches for a zero of
c(S) - A - S + X1 without bounding its Newton iterations. With a
negative dividend yield this function can remain positive, so the
required root need not exist.

Locate its minimum analytically and use an infinite upper critical
price when exercise never beats extension. Reject call configurations
whose extension regions the current formula cannot represent,
including those that would otherwise take the vanilla-price shortcut.
Bound all four Newton searches at 100 steps and reject invalid steps.

On Linux with GCC 13.3.0:

Case 84fbf0a0e Quadrature
No-root call, first regression row Timed out after 20 s 3.51340009
No-root call, second regression row Timed out after 20 s 15.84525780
Two roots below the first strike 18.06229040 25.36335667

With this change all three match the quadrature values within the test's 1e-4 tolerance.

testHolderExtensibleOptionNegativeDividendYield checks supported
prices against numerical integration with mpmath 1.3.0 at an absolute
tolerance of 1e-4, and checks errors for unsupported call regions and
saturated Newton derivatives. Rejection intentionally replaces some
previously returned prices.

Checked on Ubuntu 24.04 with GCC 13.3.0, Boost 1.83.0, Release and
QL_COMPILE_WARNING_AS_ERROR=ON: all four ExtensibleOptionsTests
cases pass in C++17 and C++20. With the production files at
84fbf0a0e, the new test does not finish (stopped after 300 s).

This does not address the existing negative-yield put discrepancies
or change the absolute 0.001 Newton residual tolerance.

AI disclosure: this was prepared with AI assistance (Claude Opus 5.5 and Claude Sonnet 5.5).

🤖 Generated with Claude Code

https://claude.ai/code/session_01JfvcPZyKcKQUG9fQGYfRMw

With a negative dividend yield, c(S) - A - S + X1 can have no zero.
The existing unbounded Newton search timed out on the regression
inputs.

Locate the minimum analytically and use an infinite upper critical
price when exercise never beats extension. Reject unsupported call
extension regions, including those bypassed by the vanilla shortcut.

Bound all four Newton searches at 100 steps and reject non-finite
residuals, invalid derivatives and non-positive or non-finite steps.
Add price references and expected-error checks to the regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JfvcPZyKcKQUG9fQGYfRMw
Signed-off-by: Jackmeson1 <130693642+Jackmeson1@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant